#include "package.h"
#include "log.h"
#include "Protocol.h"

namespace base {

	Package::Package()
	{
	}


	Package::~Package()
	{
	}

	bool Package::chkHead( const char* data, size_t datasize )
	{
		if (datasize < sizeof(PROTO_HEAD)) {
			return false;
		}
		PROTO_HEAD* head = (PROTO_HEAD *)data;
		//LOG_DEBUG("CMD:"<<head->cmd<<",LEN"<<head->len);
		return true;
	}

	const char* Package::getData(const char* data)
	{
		return data + sizeof(PROTO_HEAD);
	}

}
